<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:73:"D:\important\netwws-cms\public/../application/admin\view\files\lists.html";i:1507614517;s:76:"D:\important\netwws-cms\public/../application/admin\view\extends\extend.html";i:1507614517;}*/ ?>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <!--bootstarp-->
    <link href="__admin__/css/bootstrap.min.css" rel="stylesheet">
    <!-- 图标-->
    <link href="__admin__/css/font-awesome.min.css" rel="stylesheet">
    <!-- animate -->
    <link href="__admin__/css/animate.min.css" rel="stylesheet">
    <!--自定义css-->
    <link href="__admin__/css/style.min.css" rel="stylesheet">
    
    <!--美化 checkbox radio css-->
    <link href="__admin__/css/plugins/iCheck/custom.css" rel="stylesheet">

</head>
<body class="gray-bg">

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>上传文件列表</h5>
                        <div class="ibox-tools">
                            <a href="javascript:location.reload(true);" class="btn btn-outline btn-info btn-xs">
                                <i class="fa fa-refresh"></i> 刷新
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <!--<div class="row">-->
                            <!--<div class="col-sm-12 m-b-xs">-->
                                <!--<div class="btn-group">-->
                                    <!--<a href="javascript:;" data-url="" class="btn btn-success batchUpdate" type="button">更新排序</a>-->
                                    <!--<a href="" class="btn btn-info btn-rounded" type="button">新增栏目</a>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>序</th>
                                    <th>类型</th>
                                    <th>原文件名</th>
                                    <th>存储路径</th>
                                    <th>文件大小</th>
                                    <th>上传时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(!(empty($file) || (($file instanceof \think\Collection || $file instanceof \think\Paginator ) && $file->isEmpty()))): if(is_array($file) || $file instanceof \think\Collection || $file instanceof \think\Paginator): $i = 0; $__LIST__ = $file;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                                        <tr>
                                            <td><?php echo $i; ?></td>
                                            <td><?php echo $v['type']; ?></td>
                                            <td><a href=""><?php echo $v['name']; ?></a></td>
                                            <td><?php echo $v['save_path']; ?></td>
                                            <td><?php echo $v['size']; ?></td>
                                            <td><?php echo $v['create_time']; ?></td>
                                            <td>
                                                <?php if($v['type'] == 'img'): ?>
                                                    <a href="<?php echo $v['save_path']; ?>" class="btn btn-warning btn-sm" target="_blank">预览</a>
                                                <?php endif; ?>
                                                <a href="<?php echo url('files/delFile',['file_id'=>$v['file_id']]); ?>" class="btn btn-danger btn-sm">删除</a>
                                            </td>
                                        </tr>
                                    <?php endforeach; endif; else: echo "" ;endif; else: ?>
                                    <tr>
                                        <td colspan="6" align="center">暂无数据!</td>
                                    </tr>
                                <?php endif; ?>

                                </tbody>
                            </table>
                        </div>
                        <?php if(!(empty($file) || (($file instanceof \think\Collection || $file instanceof \think\Paginator ) && $file->isEmpty()))): ?>
                            <?php echo $file->render(); endif; ?>
                    </div>
                </div>
            </div>

        </div>
    </div>

<!-- jquery-->
<script src="__admin__/js/jquery.min.js"></script>
<!-- bootstarp-->
<script src="__admin__/js/bootstrap.min.js"></script>

    <!--美化 checkbox radio js-->
    <script src="__admin__/js/plugins/iCheck/icheck.min.js"></script>
    <!-- sweetalert js -->
    <script src="__admin__/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
        $(document).ready(function(){
            $(".i-checks").iCheck({
                checkboxClass:"icheckbox_square-green",
                radioClass:"iradio_square-green",
            });
            $('#checkAll').on('ifChecked', function(event){
                $('.i-checks').iCheck('check');
            });
            $('#checkAll').on('ifUnchecked', function(event){
                $('.i-checks').iCheck('uncheck');
            });
            $('.batchUpdate').on('click',function () {
                var sortInput   =   $('.table td .sortInput:input');
                console.log(sortInput);
                if(sortInput.length > 0){
                    var url = $(this).data('url');
                    $.get(url, sortInput.serialize(), function (data) {
                        swal({title: data.msg, icon: data.code?'success':'warning',dangerMode: true,}).then(function () {
                            location.reload(true)
                        });
                    }, 'json');
                }else{
                    swal({title: '当前没有数据无法排序呢!', icon: "warning",dangerMode: true,})
                }
            });
        });
    </script>

</body>
</html>
